package com.fitzpatrickit.robotics.hexaped;

import lejos.nxt.Motor;
import lejos.nxt.NXTRegulatedMotor;
import lejos.nxt.SensorPort;
import lejos.robotics.subsumption.Arbitrator;
import lejos.robotics.subsumption.Behavior;

public class HexapedMain {
	
	public static void main(String[] args) {
		
		//RConsole.openUSB(0);
		
		final NXTRegulatedMotor centerMotor = Motor.A;
		final NXTRegulatedMotor rightMotor = Motor.B;
		final NXTRegulatedMotor leftMotor = Motor.C;
		
		SonarSampler sonarSampler = new SonarSampler(SensorPort.S3, 20, 30);
		HexapedMoveController hexapedMoveController = new HexapedMoveController(centerMotor, rightMotor, leftMotor);
		ExploreBehaviour exploreBehaviour = new ExploreBehaviour(hexapedMoveController, sonarSampler);
		Behavior terminateBehavior = new TerminateBehaviour(hexapedMoveController);
		
		Behavior[] behaviors = new Behavior[] { exploreBehaviour, terminateBehavior };
		
		Arbitrator arby = new Arbitrator(behaviors);
		
		arby.start();
	}
}
